package com.coding.controller;

import com.coding.serivce.AsyncServicer;
import com.coding.serivce.EmialSerice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * -- Created by IntelliJ IDEA.
 * -- REMARK:
 * -- User: tanwei
 * -- Date: 2020/7/5
 * -- Time: 8:46 上午
 * --
 */
@Controller
public class IdexController {

    @Autowired
    AsyncServicer asyncServicer;

    @Autowired
    EmialSerice emialSerice;

    @RequestMapping({"/", "index.html", "/"})
    public String index() {
        return "login";
    }


    @RequestMapping({"/hello"})
    @ResponseBody
    public String hello() {
        asyncServicer.hello();
        return "sucess";
    }

    @RequestMapping("/sendEmial")
    @ResponseBody
    public  String sendEmial(){
        emialSerice.senMail();
        return "sucess";
    }

}
